package br.edu.granbery.indianostore.action;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import br.edu.granbery.indianostore.controller.Action;

public class CancelarCarrinhoAction implements Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		HttpSession sessao = request.getSession(true);
		sessao.removeAttribute("Carrinho");
		RequestDispatcher view;
		try {
			view = request.getRequestDispatcher("/index.jsp");
			view.forward(request, response);
		} catch (ServletException ex) {
			Logger.getLogger(CadastrarProdutoAction.class.getName()).log(
					Level.SEVERE, null, ex);
		}
		
	}

}
